<!--
  @author: 善良的YWJ
  @Created by shanliangdeYWJ on 2020/11/02 16:49:03
  @file: loading.vue
  @description:
  ==================
  loading 加载组件
  ==================
  @link [Github](https://github.com/shanliangdeYWJ)
-->

<template>
  <transition name="fade">
    <div class="loading-wrapper" v-if="showLoading">
      <Loading></Loading>
    </div>
  </transition>
</template>

<script>
import Loading from '@/components/loading';
export default {
  name: 'GFLoadingPage',
  components: { Loading },
  props: {
    showLoading: {
      type: Boolean,
      default: true
    }
  }
};
</script>

<style lang='scss' scoped>
.loading-wrapper {
  position: fixed;
  z-index: 10;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  background: #f8f8f8;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.5s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
  opacity: 0;
}
</style>
